package com.mhc.suzuki.manager.impl;

import com.mhc.suzuki.dal.mapper.ext.PaymentRequestExtMapper;
import com.mhc.suzuki.dal.model.PaymentRequestDO;
import com.mhc.suzuki.dal.query.PaymentRequestQuery;
import com.mhc.suzuki.manager.PaymentRequestManager;
import com.subaru.common.query.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;


/**
 * Manager for PaymentRequest.
 */

@Component
public class PaymentRequestManagerImpl implements PaymentRequestManager {


    @Autowired
    protected PaymentRequestExtMapper paymentRequestExtMapper;

    /**
     * query count by query condition.
     */
    @Override
    public int countByQuery(PaymentRequestQuery query) {
        return paymentRequestExtMapper.countByQuery(query);
    }

    /**
     * delete by query condition.
     */
    @Override
    public int deleteByQuery(PaymentRequestQuery query) {
        return paymentRequestExtMapper.deleteByQuery(query);
    }

    /**
     * delete by primary key.
     */
    @Override
    public int deleteByPrimaryKey(PaymentRequestDO record) {
        return paymentRequestExtMapper.deleteByPrimaryKey(record);
    }

    /**
     * insert selective.
     */
    @Override
    public long insertSelective(PaymentRequestDO record) {
        return paymentRequestExtMapper.insertSelective(record);
    }

    /**
     * select by query condition.
     */
    @Override
    public List<PaymentRequestDO> selectByQuery(PaymentRequestQuery query) {
        return paymentRequestExtMapper.selectByQuery(query);
    }

    /**
     * select by query condition with page.
     */
    @Override
    public PageResult<PaymentRequestDO> selectByQueryWithPage(PaymentRequestQuery query) {
        PageResult<PaymentRequestDO> result = new PageResult<PaymentRequestDO>();
        result.setPageSize(query.getPageSize());
        result.setPageNo(query.getPageNo());
        result.setTotalCount(this.countByQuery(query));
        result.setResult(this.selectByQuery(query));
        return result;
    }

    /**
     * select by primary key.
     */
    @Override
    public PaymentRequestDO selectByPrimaryKey(Long id) {
        return paymentRequestExtMapper.selectByPrimaryKey(id);
    }

    /**
     * select by order no.
     */
    @Override
    public PaymentRequestDO selectByOrderNo(String orderNo) {
        return paymentRequestExtMapper.selectByOrderNo(orderNo);
    }

    /**
     * update by query condition selective.
     */
    @Override
    public int updateByQuerySelective(PaymentRequestDO record, PaymentRequestQuery query) {
        return paymentRequestExtMapper.updateByQuerySelective(record, query);
    }

    /**
     * update by query condition.
     */
    @Override
    public int updateByQuery(PaymentRequestDO record, PaymentRequestQuery query) {

        return paymentRequestExtMapper.updateByQuery(record, query);
    }

    /**
     * update by primary key selective.
     */
    @Override
    public int updateByPrimaryKeySelective(PaymentRequestDO record) {
        return paymentRequestExtMapper.updateByPrimaryKeySelective(record);
    }
}
